package com.ws.datasync.controller;

import com.ws.datasync.common.util.Result;
import com.ws.datasync.service.CompareDataService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/compare")
public class CompareDataController {

    private static final Logger logger = LoggerFactory.getLogger(CompareDataController.class);

    @Autowired
    private CompareDataService compareDataService;

    @RequestMapping("/primary")
    public Result comparePrimaryData() {
        return compareDataService.comparePrimaryData();
    }

    @RequestMapping("/primary/async")
    public Result comparePrimaryDataAsync() {
        return compareDataService.comparePrimaryDataAsync();
    }

    @RequestMapping("/diffData")
    public Result diffData(String tableName,HttpServletRequest request) {
         return compareDataService.diffData(tableName);
    }


}
